With the high-speed development of 3G network, a Precision Time Protocol (simply “PTP” for short) has been taken more and more attentions and been applied widely. The PTP protocol is utilized consistently by operators at home and abroad for the time synchronization, and is gradually replacing the way of using Global Position System (simply “GPS” for short) for the time synchronization.
Currently, the time synchronization technologies utilized by operators include PTP, Network Time Protocol (simply “NTP” for short) and China Mobile's high precision time synchronization (1 Pulse per Second+Time of Day, 1PPS+TOD), which employ different protocol formats respectively. As applications of the time network expands continuously, intercommunication among different time synchronization technologies is required, for example, 1PPS+TOD is commonly used currently for the intercommunication between the synchronization technology of the Optical Transport Network (simply “OTN” for short) and the synchronization technology of the Packet Transport Network (simply “PTN” for short). In addition, within a synchronization network, there are different types of time interfaces on certain synchronization equipments. For example, there are a 1PPS+TOD interface and a PTP interface on a synchronization equipment, and at this point a mixed source selection needs to be supported. However, since the 1PPS+TOD protocol can only carry the time information and a second pulse state, can not carry more time source information, such as grandmother clock identity, priority parameters, the number of hops, the types of time sources and so on. Therefore, the upstream time source information is lost after passing through a 1PPS+TOD synchronization interface, thereby forming a timing loop under some situations.
In the following, a process of forming the timing loop under a situation of a time ring network is introduced in detail:
FIG. 1 is a schematic diagram of forming a timing loop under a situation of a time ring network according to the related art, and as shown in FIG. 1, there are four synchronization equipments (network equipments) in the time ring network, i.e. network equipment 1 (NE1), network equipment 2 (NE2), network equipment 3 (NE3), and network equipment 4 (NE4), respectively. In this situation, there is a 1PPS+TOD link between the NE1 and the NE2, and there are PTP links among other adjacent equipments. Firstly, clock parameters of these equipments need to be configured within the time ring network, wherein the clock parameters mainly comprise: clock identity (ID) (for example, the clock identities of the NE1, the NE2, the NE3 and the NE4 can be uniquely represented by each MAC address respectively), priority level 1 (priority1), priority level 2 (priority2) and clock class and so on.
In particular, as shown in FIG. 1, the clock ID configured for NE2 is NE2 Mac, priority1=20, priority2=22, and so on for other NEs, and the requirements of an existing time synchronization method are that:
(1) when there are both 1PPS+TOD synchronization input interface and PTP input port on an equipment, it should support to select a best master time source among multiple PTP input sources and multiple 1PPS+TOD input sources;
(2) when the 1PPS+TOD is selected by the equipment as the current best master time source, and the type of the output port is PTP, it is needed to perform a parameter remapping, namely a data set of 1PPS+TOD reference sources is needed to be constructed on a local node, wherein the data set contains parameters such as: grandmother clock identity (grandmaster Identity), priority level 1 (priority1), priority level 2 (priority2), the class of the clock (Clock Class), port number (portNumber), the number of hops (stepsRemoved), the accuracy of the clock (clockAccuracy), the jitter of the clock (offsetScaledLogVariance), time source (timesource) and time scale (TimeScale);
(3) grandmasterIdentity, priority1 and priority2 shall be able to be configured on a network manager, and other parameters can be configured to be equipment default values, wherein the value of the Timesource is configured to be 0×20 by default, and the value of the stepsRemoved is configured to be 0 by default.
With reference to FIG. 1, there are two PTP ports and one 1PPS+TOD interface on the equipment NE1; suppose that PTP port 1 is selected as a slave port by the NE1, at this time another PTP port is the master port and the PTP port 2 send to the NE3 a PTP announce message, the parameters carried in the PTP announce message include GMid, priority1, priority2, ClockClass, stepsRemoved, timesource of a upstream time source, and these parameters are transferred from an upstream reference source. However, for the 1PPS+TOD interface, it can only carry a second pulse state and time information of the upstream, wherein the TOD second pulse state is mapped to the ClockClass of the PTP, and the time information includes the number of weeks and the number of seconds within a week; it can be found that other parameters of the upstream time source can not be transferred on the 1PPS+TOD interface, such as GMid, priority1, priority2, stepsRemoved, timesource and so on, and these parameters can only be constructed locally, namely the 1PPS+TOD interface is mapped into a common PTP port.
For the NE2, when the 1PPS+TOD interface is selected as a master time interface, with the configured parameters of priority1=10, priority2=10, which are superior to those of priority1=10, priority2=12 of a upstream time source; in addition, the NE2 also receives PTP announce messages of the upstream time source and the downstream time source from other PTP ports, but the NE2 will select the 1PPS+TOD interface as a master clock after a comparison by a BMC algorithm, and at this time the NE2 will send PTP announce messages to the NE1, the NE3 and the NE4 respectively; wherein, the parameters of the sent PTP announce messages are GMid=NE2, p1=10, p2=10, stepsRemoved=0, timesource=0×20; at this time, the NE3 will be synchronized to the NE2; for the NE1, it receives information sent respectively from two time sources via two PTP ports, and the NE1 will select the PTE port 2 as the master clock after a comparison by the BMC algorithm, thereby forming a timing loop. It can be seen with reference to FIG. 1, a particular process of forming a timing loop is as followings:
step 1, for the NE2, the 1PPS+TOD synchronization input interface is mapped into a PTP interface, namely a data set of 1PPS+TOD reference sources is constructed, and in the embodiment, it is supposed that the configurations are priority1=10, priority2=10;
step 2, the NE2 performs the BMC (Best Master Clock) algorithm, and selects the 1PPS+TOD interface as a master time source, and at this time, the 1PPS+TOD interface is in Slave state and other PTP interface are in a Master state;
step 3, via the PTP port, the NE2 sends respectively to the NE3, the NE4 the PTP announce message, the clock parameters carried in the PTP announce message are that respectively: grandmasterIdentity is MAC address of the NE2, the value of the priority1 is 10, the value of the priority2 is 10, and the value of the ClockClass is the value corresponding to the TOD second pulse state;
step 4, the NE3 receives the PTP announce message of the NE2, and finds that the clock parameters are superior to its own (since its own clock parameters are priority1=20, priority2=21, but the clock parameters from the NE2 are priority1=10, priority2=10), as the NE3 is synchronized to the NE2 according to the BMC algorithm;
step 5, the NE1 receives the announce message with priority1=10, priority2=10 from the NE3, and the NE1 is synchronized to the NE3 according to the BMC algorithm, thus a timing loop of NE1-NE2-NE3 being formed.
Aiming at the problem in the related art that it is liable to form a timing loop when a mixed source selection is performed among different time synchronization technologies, effective solutions are not presented so far.